package gitapp.oschina.net.my_osc.ui.fragments;

import android.os.Bundle;

import gitapp.oschina.net.my_osc.R;
import gitapp.oschina.net.my_osc.adapter.ViewPageFragmentAdapter;
import gitapp.oschina.net.my_osc.ui.basefragment.BaseViewPagerFragment;

import static gitapp.oschina.net.my_osc.ui.fragments.ExploreProjectsFragment.EXPLORE_TYPE;
import static gitapp.oschina.net.my_osc.ui.fragments.ExploreProjectsFragment.TYPE_FEATURED;
import static gitapp.oschina.net.my_osc.ui.fragments.ExploreProjectsFragment.TYPE_LATEST;
import static gitapp.oschina.net.my_osc.ui.fragments.ExploreProjectsFragment.TYPE_POPULAR;

public class ExploreViewPagerFragment extends BaseViewPagerFragment {


    public static ExploreViewPagerFragment newInstance() {
        return new ExploreViewPagerFragment();
    }

    @Override
    protected void onSetupTabAdapter(ViewPageFragmentAdapter adapter) {
        String[] title = getResources().getStringArray(R.array.explore_title_array);
        Bundle featuredBundle = new Bundle();
        featuredBundle.putByte(EXPLORE_TYPE, TYPE_FEATURED);
        adapter.addTab(title[0], "featured", ExploreProjectsFragment.class, featuredBundle);
        Bundle popularBundle = new Bundle();
        popularBundle.putByte(EXPLORE_TYPE, TYPE_POPULAR);
        adapter.addTab(title[1], "popular", ExploreProjectsFragment.class, popularBundle);
        Bundle latestdBundle = new Bundle();
        latestdBundle.putByte(EXPLORE_TYPE, TYPE_LATEST);
        adapter.addTab(title[2], "latest", ExploreProjectsFragment.class, latestdBundle);
    }

}

